<template>
  <TableView
    ref="tableView"
    :table-attrs="{ api: getPage, descs: ['createTime'], payloadStyle: 'body', dicOptions: [] }"
    :form-path="formRoute"
    :search-model="searchForm"
    :delete-api="batchDelete">
    <template #columns>
      <TableColumn label="姓名" prop="name" clickable/>
      <TableColumn label="性别" prop="gender" dict-type="gender"/>
      <TableColumn label="出生日期" prop="birthday" />
      <TableColumn label="证件类型" prop="idType" />
      <TableColumn label="证件号码" prop="idNo" />
      <TableColumn label="专业技术职称" prop="technicalTitles" dict-type="technical_titles"/>
      <TableColumn label="职务" prop="duties" />
      <TableColumn label="最高学历" prop="education" />
      <TableColumn label="所属项目" prop="projectName" />
      <TableColumn label="专业" prop="speciality" />
      <TableColumn label="投入本项目的全部工作时间（人月）" prop="workMoth" />
      <TableColumn label="人员分类" prop="memberType"/>
      <!--<TableColumn label="所属课题" prop="topic" />-->
      <TableColumn label="是否有工资性收入" prop="hasWageIncome" dict-type="yes_no"/>
      <TableColumn label="工作单位" prop="workUnit" />
    </template>
    <template #search-form>
      <FormInput v-model="searchForm.name" label="姓名" prop="name" />
      <FormInput v-model="searchForm.idType" label="证件类型" prop="idType" />
      <FormInput v-model="searchForm.idNo" label="证件号码" prop="idNo" />
      <FormInput v-model="searchForm.duties" label="职务" prop="duties" />
      <FormInput v-model="searchForm.speciality" label="专业" prop="speciality" />
      <FormInput v-model="searchForm.memberType" label="人员分类" prop="memberType" />
      <FormInput v-model="searchForm.workUnit" label="工作单位" prop="workUnit" />
      <FormInput v-model="searchForm.projectName" label="所属项目名称" prop="projectName" />
      <FormInput v-model="searchForm.technicalTitles" label="专业技术职称" prop="technicalTitles" />
    </template>
  </TableView>
</template>

<script>
  import { getPage, batchDelete } from './api'

  export default {
    name: 'ProjectMemberView',
    data() {
      return {
        searchForm: {
          name: null,
          idType: null,
          idNo: null,
          duties: null,
          technicalTitles: null,
          speciality: null,
          memberType: null,
          workUnit: null,
          projectName: null,
        }
      }
    },
    methods: {
      getPage,
      batchDelete,
      formRoute(item) {
        return `/tech-project/project-manage/member/ProjectMemberForm/{id:-1}?tabTitle=${item ? '' : '添加'}成员信息`
      }
    }
  }
</script>
